package com.finstone.data.spider.eshop.downloader;

import java.io.IOException;

import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;

import us.codecraft.webmagic.downloader.HttpClientDownloader;

import com.finstone.data.spider.utils.ImageBase64Utils;

public class ImageDownloader extends HttpClientDownloader {
	@Override
    protected String getContent(String charset, HttpResponse httpResponse) throws IOException {
 
        byte[] imageByte = EntityUtils.toByteArray(httpResponse.getEntity());
        String iageStr = ImageBase64Utils.getImageStr(imageByte);
        return iageStr;
    }
}
